$(function () {
    $.ajax({
        type: "get",
        url: "/cart/queryCart",
        success: function (res) {
            console.log(res);
            $('.showCart').html(template('showCart', res))
        }
    });
    $.ajax({
        url: '/user/queryUserMessage',
        type: 'get',
        // 同步
        async: false,
        success: function (res) {
            console.log(res);
            // 用户没有登录
            if (res.error && res.error == 400) {
                location.href = "login.html";
            }
        }
    });
})